package com.shujia.core

import com.alibaba.fastjson.{JSON, JSONObject}

import java.lang

object Demo06ExtractJson {
  def main(args: Array[String]): Unit = {
    val jsonStr: String = "{\"car\":\"皖A9A7N2\",\"city_code\":\"340500\",\"county_code\":\"340522\",\"card\":117988031603010,\"camera_id\":\"00120\",\"orientation\":\"西南\",\"road_id\":34053114,\"time\":1614711895,\"speed\":36.38}"

    val jsonObj: JSONObject = JSON.parseObject(jsonStr)

    val card: lang.Long = jsonObj.getLong("card")
    val car: String = jsonObj.getString("car")
    println(card)
    println(car)
  }

}
